package com.itstyle.seckill.queue.delay.jvm;

import org.redisson.api.RDelayedQueue;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;
import java.util.concurrent.Executors;

/**
 * @Auther: liuwenxiang
 * @Date: 2020/3/8 23:48
 * @Description:
 */
public class Queue {
    private static DelayQueue<RedPacketMessage> queue = new DelayQueue<>();

    private Queue(){}

    private static class SingleHolder{
        private static Queue queue  =new Queue();
    }
    public  static  Queue getQueue(){
        return  SingleHolder.queue;
    }

    public void add(RedPacketMessage redPacketMessage){
        queue.add(redPacketMessage);
    }

    public static void main(String[] args) {
        Runnable task=()->{
            CountDownLatch countDownLatch =new CountDownLatch(10);

        };
        Executors.newCachedThreadPool().execute(new Runnable() {
            @Override
            public void run() {

            }
        });
    }


}
